package com.eastjet.maintenance.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import lombok.Data;

/**
 * 入库明细
 *
 * @TableName inbound_details
 */
@TableName(value = "inbound_details")
@Data
public class InboundDetails implements Serializable {
    /**
     * 入库明细主键id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 入库或者出库单号
     */
    private String discrepancyCode;

    /**
     * 备件编码
     */
    private String encode;

    /**
     * 备件名称
     */
    private String name;

    /**
     * 规格型号
     */
    private String specification;

    /**
     * 备件类型外键
     */
    private String type;

    /**
     * 品牌
     */
    private String brand;

    /**
     * 单位
     */
    private String unit;


    /**
     * 入库数量
     */
    private String inboundQuantity;

    /**
     * 出库数量
     */
    private String outboundQuantity;

    /**
     * 存放位置
     */
    private String storageLocation;

    /**
     * 出库入库选择
     */
    private String discrepancy;

    /**
     * 备注
     */
    private String remark;

    /**
     * 创建人
     */
    private String createdBy;

    /**
     * 创建时间
     */
    private Date creationTime;

    /**
     * 更新人
     */
    private String updater;

    /**
     * 更新时间
     */
    private Date updated;

    /**
     * 逻辑删除
     */
    private Integer tombstone;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        InboundDetails other = (InboundDetails) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getDiscrepancyCode() == null ? other.getDiscrepancyCode() == null : this.getDiscrepancyCode().equals(other.getDiscrepancyCode()))
                && (this.getEncode() == null ? other.getEncode() == null : this.getEncode().equals(other.getEncode()))
                && (this.getInboundQuantity() == null ? other.getInboundQuantity() == null : this.getInboundQuantity().equals(other.getInboundQuantity()))
                && (this.getOutboundQuantity() == null ? other.getOutboundQuantity() == null : this.getOutboundQuantity().equals(other.getOutboundQuantity()))
                && (this.getStorageLocation() == null ? other.getStorageLocation() == null : this.getStorageLocation().equals(other.getStorageLocation()))
                && (this.getDiscrepancy() == null ? other.getDiscrepancy() == null : this.getDiscrepancy().equals(other.getDiscrepancy()))
                && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
                && (this.getCreatedBy() == null ? other.getCreatedBy() == null : this.getCreatedBy().equals(other.getCreatedBy()))
                && (this.getCreationTime() == null ? other.getCreationTime() == null : this.getCreationTime().equals(other.getCreationTime()))
                && (this.getUpdater() == null ? other.getUpdater() == null : this.getUpdater().equals(other.getUpdater()))
                && (this.getUpdated() == null ? other.getUpdated() == null : this.getUpdated().equals(other.getUpdated()))
                && (this.getTombstone() == null ? other.getTombstone() == null : this.getTombstone().equals(other.getTombstone()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getDiscrepancyCode() == null) ? 0 : getDiscrepancyCode().hashCode());
        result = prime * result + ((getEncode() == null) ? 0 : getEncode().hashCode());
        result = prime * result + ((getInboundQuantity() == null) ? 0 : getInboundQuantity().hashCode());
        result = prime * result + ((getOutboundQuantity() == null) ? 0 : getOutboundQuantity().hashCode());
        result = prime * result + ((getStorageLocation() == null) ? 0 : getStorageLocation().hashCode());
        result = prime * result + ((getDiscrepancy() == null) ? 0 : getDiscrepancy().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getCreatedBy() == null) ? 0 : getCreatedBy().hashCode());
        result = prime * result + ((getCreationTime() == null) ? 0 : getCreationTime().hashCode());
        result = prime * result + ((getUpdater() == null) ? 0 : getUpdater().hashCode());
        result = prime * result + ((getUpdated() == null) ? 0 : getUpdated().hashCode());
        result = prime * result + ((getTombstone() == null) ? 0 : getTombstone().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", discrepancyCode=").append(discrepancyCode);
        sb.append(", encode=").append(encode);
        sb.append(", inboundQuantity=").append(inboundQuantity);
        sb.append(", outboundQuantity=").append(outboundQuantity);
        sb.append(", storageLocation=").append(storageLocation);
        sb.append(", discrepancy=").append(discrepancy);
        sb.append(", remark=").append(remark);
        sb.append(", createdBy=").append(createdBy);
        sb.append(", creationTime=").append(creationTime);
        sb.append(", updater=").append(updater);
        sb.append(", updated=").append(updated);
        sb.append(", tombstone=").append(tombstone);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}